package com.teach.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.teach.entity.RoleInfo;
import com.teach.mapper.RoleInfoMapper;
import com.teach.service.RoleService;

@Service
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleInfoMapper mapper;
	
	@Override
	@Cacheable(value = "role",key = "'listAll'")
	public List<RoleInfo> listAll() {
		return mapper.select();
	}

	@Cacheable(value = "role",key = "#roleId")
	@Override
	public RoleInfo get(Integer roleId) {
		return mapper.selectByPrimaryKey(roleId);
	}

}
